Imports System.Xml.Serialization
Namespace Mapping

    Public Class AssociationSetMapping
        Inherits XEntityModelElementBase

        ''' <summary>Initializes an instance of the <see cref="AssociationSetMapping" /> class.
        ''' This is the default constructor for this class.</summary>
        Public Sub New()
            MyBase.New("AssociationSetMapping", CSXmlNamespace)
        End Sub

        ''' <summary>Initializes an instance of the <see cref="AssociationSetMapping" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        Private __endProperty As EndPropertyCollection
        Private __condition As ConditionCollection
        Public Property QueryView() As String
            Get
                Return Me.@QueryView
            End Get
            Set(ByVal value As String)
                Me.@QueryView = value
            End Set
        End Property

        <AutoLoad()> _
        <XmlElement("EndProperty", GetType(EndProperty))> _
        Public ReadOnly Property EndProperties() As EndPropertyCollection
            Get
                If (__endProperty Is Nothing) Then
                    __endProperty = New EdmxEditor.Mapping.EndPropertyCollection(Me, MyBase.Name.Namespace, "EndProperty")
                End If
                Return __endProperty
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("Condition", GetType(Condition))> _
        Public ReadOnly Property Conditions() As ConditionCollection
            Get
                If (__condition Is Nothing) Then
                    __condition = New EdmxEditor.Mapping.ConditionCollection(Me, MyBase.Name.Namespace, "Condition")
                End If
                Return __condition
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("ModificationFunctionMapping")> _
        Public Property ModificationFunctionMapping() As AssociationSetModificationFunctionMapping
            Get
                Return DirectCast(Me.Element(MyBase.Name.Namespace + "ModificationFunctionMapping"), EdmxEditor.Mapping.AssociationSetModificationFunctionMapping)
            End Get
            Set(ByVal value As AssociationSetModificationFunctionMapping)
                If (DirectCast(value, XElement).Name <> (MyBase.Name.Namespace + "ModificationFunctionMapping")) Then
                    Throw New ArgumentException("Invalid Element")
                End If
                If (Me.ModificationFunctionMapping IsNot Nothing) Then
                    Me.ModificationFunctionMapping.Remove()
                End If
                Me.Add(New EdmxEditor.Mapping.AssociationSetModificationFunctionMapping(value))
            End Set
        End Property

        <XmlAttribute(DataType:="token")> _
        Public Shadows Property Name() As String
            Get
                Return Me.@Name
            End Get
            Set(ByVal value As String)
                Me.@Name = value
            End Set
        End Property

        <XmlAttribute(DataType:="token")> _
        Public Property TypeName() As String
            Get
                Return Me.@TypeName
            End Get
            Set(ByVal value As String)
                Me.@TypeName = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property StoreEntitySet() As String
            Get
                Return Me.@StoreEntitySet
            End Get
            Set(ByVal value As String)
                Me.@StoreEntitySet = value
            End Set
        End Property

    End Class

End Namespace
